package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.util.List;

/**
 * Created by root on 17-9-19.
 */
@Entity
@Table(name = "privilege_list", schema = "", catalog = "")
public class PrivilegeListEntity extends IAcross
{
	private int priId;
	private int priGrpId;
	private String priCode;
	private String priName;
	private String priType;

	@Transient
	public List<PrivilegeListEntity> priList;


	@Id
	@Column(name = "pri_id", nullable = false)
	public int getPriId()
	{
		return priId;
	}

	public void setPriId(int priId)
	{
		this.priId = priId;
	}

	@Basic
	@Column(name = "pri_grp_id", nullable = false)
	public int getPriGrpId()
	{
		return priGrpId;
	}

	public void setPriGrpId(int priGrpId)
	{
		this.priGrpId = priGrpId;
	}

	@Basic
	@Column(name = "pri_code", nullable = false, length = 39)
	public String getPriCode()
	{
		return priCode;
	}

	public void setPriCode(String priCode)
	{
		this.priCode = priCode;
	}

	@Basic
	@Column(name = "pri_name", nullable = true, length = 79)
	public String getPriName()
	{
		return priName;
	}

	public void setPriName(String priName)
	{
		this.priName = priName;
	}

	@Basic
	@Column(name = "pri_type", nullable = true, length = 9)
	public String getPriType()
	{
		return priType;
	}

	public void setPriType(String priType)
	{
		this.priType = priType;
	}

	@Override
	public boolean equals(Object o)
	{
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		PrivilegeListEntity that = (PrivilegeListEntity) o;

		if (priId != that.priId) return false;
		if (priGrpId != that.priGrpId) return false;
		if (priCode != null ? !priCode.equals(that.priCode) : that.priCode != null) return false;
		if (priName != null ? !priName.equals(that.priName) : that.priName != null) return false;
		if (priType != null ? !priType.equals(that.priType) : that.priType != null) return false;

		return true;
	}

	@Override
	public int hashCode()
	{
		int result = priId;
		result = 31 * result + priGrpId;
		result = 31 * result + (priCode != null ? priCode.hashCode() : 0);
		result = 31 * result + (priName != null ? priName.hashCode() : 0);
		result = 31 * result + (priType != null ? priType.hashCode() : 0);
		return result;
	}
}
